#region The MIT License
// The MIT License
// 
// Copyright (c) 2011 octalforty studios
// 
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
// 
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
// 
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#endregion
using System.Collections.Generic;

namespace octalforty.Staytuned.ObjectModel
{
    /// <summary>
    /// Represents a message which ultimatelly gets sent to a recipient.
    /// </summary>
    public class Message
    {
        /// <summary>
        /// Gets the sender of the message.
        /// </summary>
        public SenderDescriptor Sender { get; set; }

        /// <summary>
        /// Get the subject line of the <see cref="Message"/>.
        /// </summary>
        public string Subject { get; set; }

        /// <summary>
        /// Gets the body of the messages.
        /// </summary>
        public string Body { get; set; }

        /// <summary>
        /// Gets a list of attachments for this <see cref="Message"/>.
        /// </summary>
        /// <seealso cref="Attachment"/>
        public IList<Attachment> Attachments { get; private set; }

        /// <summary>
        /// Gets a dictionary of additional headers to be passed along with this <see cref="Message"/>.
        /// </summary>
        public IDictionary<string, string> Headers { get; private set; }

        /// <summary>
        /// Gets or sets an <see cref="Address"/> which describes and address
        /// used to reply to this <see cref="Message"/>.
        /// </summary>
        public Address ReplyTo { get; set; }

        /// <summary>
        /// Initializes a new instance of the <see cref="Message"/> class.
        /// </summary>
        public Message()
        {
            Attachments = new List<Attachment>();
            Headers = new Dictionary<string, string>();
        }
        
        /// <summary>
        /// Initializes a new instance of the <see cref="Message"/> class.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="body"></param>
        public Message(SenderDescriptor sender, string body) :
            this()
        {
            Sender = sender;
            Body = body;
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="Message"/> class.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="subject"></param>
        /// <param name="body"></param>
        public Message(SenderDescriptor sender, string subject, string body) :
            this()
        {
            Sender = sender;
            Subject = subject;
            Body = body;
        }
    }
}